﻿using System;
using System.Globalization;
using TabbedTemplate.Models;
using TabbedTemplate.Util;
using Xamarin.Forms;

namespace TabbedTemplate.Converters
{
    public class ItemTappedEventArgsToStoreFavoriteConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter,
            CultureInfo culture) =>
            (value as ItemTappedEventArgs)?.Item as StoreFavorite;

        public object ConvertBack(object value, Type targetType, object parameter,
            CultureInfo culture)
        {
            throw new DoNotCallThisException();
        }
    }
}
